﻿using System;
using Web7.Context;
using Web7.Core.Configuration;

namespace Web7.Core.Context
{
    public class DefaultWeb7ApplicationContext:IWeb7ApplicationContext
    {
        public DefaultWeb7ApplicationContext(Web7Settings settings,IFrameworkContext frameworkContext)
        {
            Settings = settings;
            FrameworkContext = frameworkContext;
        }

        public IFrameworkContext FrameworkContext { get; private set; }

        private Guid? _appId = null;
        public Guid ApplicationId
        {
            get
            {
                if (_appId == null)
                    _appId = Guid.NewGuid();
                return _appId.Value;
            }
        }


        public Web7Settings Settings { get; private set; }
    }
}
